package com.zline.foodraise.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by heshantao on 15/7/23.
 * 评论
 */
public class CommentBean implements Parcelable{
    //评论Id
    long commentId;
    //评论点赞数
    int commentPraiseCount;
    //评论内容
    String content;
    //创建时间
    long createTimeStamp;
    //是否点赞
    int isPraise;
    //图片列表
    List<PictureBean> pictureBeanList;
    //回复某个用户的昵称
    String replyNickName;
    //回复某个用户的Id
    long replyUserId;
    //评分
    double score;
    //用户
    CustomerUserBean userBean;
    //用户Id
    long userId;

    public CommentBean() {
    }

    public CommentBean(long commentId,int commentPraiseCount, String content,long createTimeStamp,
                       int isPraise, List<PictureBean> pictureBeanList, String replyNickName,
                       long replyUserId,double score,CustomerUserBean userBean, long userId) {
        this.commentId = commentId;
        this.content = content;
        this.commentPraiseCount=commentPraiseCount;
        this.createTimeStamp = createTimeStamp;
        this.isPraise=isPraise;
        this.pictureBeanList = pictureBeanList;
        this.replyNickName = replyNickName;
        this.replyUserId = replyUserId;
        this.score=score;
        this.userBean = userBean;
        this.userId = userId;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public long getCommentId() {
        return commentId;
    }

    public void setCommentId(long commentId) {
        this.commentId = commentId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public long getCreateTimeStamp() {
        return createTimeStamp;
    }

    public void setCreateTimeStamp(long createTimeStamp) {
        this.createTimeStamp = createTimeStamp;
    }

    public List<PictureBean> getPictureBeanList() {
        return pictureBeanList;
    }

    public void setPictureBeanList(List<PictureBean> pictureBeanList) {
        this.pictureBeanList = pictureBeanList;
    }

    public String getReplyNickName() {
        return replyNickName;
    }

    public void setReplyNickName(String replyNickName) {
        this.replyNickName = replyNickName;
    }

    public long getReplyUserId() {
        return replyUserId;
    }

    public void setReplyUserId(long replyUserId) {
        this.replyUserId = replyUserId;
    }

    public CustomerUserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(CustomerUserBean userBean) {
        this.userBean = userBean;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public int getCommentPraiseCount() {
        return commentPraiseCount;
    }

    public void setCommentPraiseCount(int commentPraiseCount) {
        this.commentPraiseCount = commentPraiseCount;
    }

    public int getIsPraise() {
        return isPraise;
    }

    public void setIsPraise(int isPraise) {
        this.isPraise = isPraise;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(commentId);
        dest.writeString(content);
        dest.writeInt(commentPraiseCount);
        dest.writeLong(createTimeStamp);
        dest.writeInt(isPraise);
        dest.writeList(pictureBeanList);
        dest.writeString(replyNickName);
        dest.writeLong(replyUserId);
        dest.writeDouble(score);
        dest.writeParcelable(userBean,flags);
        dest.writeLong(userId);

    }


    public static final Creator<CommentBean> CREATOR = new Creator<CommentBean>() {
        public CommentBean createFromParcel(Parcel in) {
            return new CommentBean(in);
        }

        public CommentBean[] newArray(int size) {
            return new CommentBean[size];
        }
    };


    private CommentBean(Parcel in){
        commentId = in.readLong();
        content = in.readString();
        commentPraiseCount=in.readInt();
        createTimeStamp = in.readLong();
        isPraise=in.readInt();
        pictureBeanList = in.readArrayList(PictureBean.class.getClassLoader());
        replyNickName =in.readString();
        replyUserId = in.readLong();
        score=in.readDouble();
        userBean = in.readParcelable(CustomerUserBean.class.getClassLoader());
        userId = in.readLong();
    }
}
